<?php

// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://demo.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 代码仓库：https://gitee.com/zoujingli/ThinkAdmin
// | github 代码仓库：https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------

namespace app\index\controller;

use think\App;


/**
 * 二手商城
 * Class Index
 * @package app\index\controller
 */
class Market extends UserBase
{


    public function __construct(App $app = null)
    {
        parent::__construct($app);
    }


    /**
     * 二手首页
     * @return mixed
     * @throws \WeChat\Exceptions\InvalidResponseException
     * @throws \WeChat\Exceptions\LocalCacheException
     */
    public function index()
    {

        $this->assignJsSign($this->request->url(true));

        return $this->fetch();
    }

    /**
     * 二手商品详情
     * @return mixed
     * @throws \WeChat\Exceptions\InvalidResponseException
     * @throws \WeChat\Exceptions\LocalCacheException
     */
    public function goodsDetail()
    {
        $goodsId = $this->request->param('id', 0);

        $this->assign('id', $goodsId);
        $this->assignJsSign($this->request->url(true));

        return $this->fetch();
    }


    /**
     * 发布二手商品
     * @return mixed
     */
    public function publishGoods()
    {

        $goodsId = $this->request->param('goodsId', 0);

        $this->assign('goodsId', $goodsId);

        $this->assign('userId', $this->userId);

        return $this->fetch();
    }


    /**
     * 我发布的二手商品
     */
    public function publishGoodsList()
    {
        $type = $this->request->param('type', 0);

        $this->assign('type', $type);

        return $this->fetch();
    }


    public function auditGoods()
    {
        $goodsId = $this->request->param('goodsId', 0);

        $this->assign('id', $goodsId);

        return $this->fetch();
    }



}
